<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('评价详情')" />
    <style type="text/css">
        .bgtd{
            text-align: right;
            background-color: #d9edf7;
        }
    </style>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-taskResult-edit" th:object="${evaTaskResult}">
            <input name="taskResuletId" th:field="*{taskResuletId}" type="hidden">
            <input name="taskId" th:field="*{taskId}" type="hidden">
            <input name="targetId" th:field="*{targetId}" type="hidden">

            <div class="row">
                <div class="col-sm-12">
                    <table id="table" class="table table-bordered" style="color:#000;table-layout:fixed;">
                        <tr style="display: none">
                            <td width="15%" class="bgtd">名称：</td>
                            <td width="35%" class="bgtd">名称：</td>
                            <td width="15%" class="bgtd">名称：</td>
                            <td width="35%" class="bgtd">名称：</td>
                        </tr>
                        <tr>
                            <td class="bgtd">名称：</td>
                            <td style="word-wrap:break-word;" colspan="3">[[${evaTaskResult.targetName}]]</td>
                        </tr>
                        <tr>
                            <td class="bgtd">年份：</td>
                            <td><span>[[${evaTaskResult.year}]]</span></td>

                            <td class="bgtd">类型：</td>
                            <td th:if="${evaTaskResult.targetClass} eq 0"><span >供应商</span></td>
                            <td th:if="${evaTaskResult.targetClass} eq 1"><span >客户</span></td>
                        </tr>
                        <tr>
                            <td class="bgtd">评分：</td>
                            <td>[[${evaTaskResult.score}]]</td>

                            <td class="bgtd">评级：</td>
                            <td th:if="${evaTaskResult.rating} eq 'A'"><span class="label label-success">A</span></td>
                            <td th:if="${evaTaskResult.rating} eq 'B'"><span class="label label-info">B</span></td>
                            <td th:if="${evaTaskResult.rating} eq 'C'"><span class="label label-primary">C</span></td>
                            <td th:if="${evaTaskResult.rating} eq 'D'"><span class="label label-warning-light">D</span></td>
                        </tr>

                    </table>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-12 select-table table-bordered">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "credit/taskResult";
        $("#form-taskResult-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-taskResult-edit').serialize());
            }
        }

        $(function() {
            var options = {
                // url: prefix + "/detailList",
                data: [[${detailList}]],
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                pagination: false,
                columns: [
                    {
                        field : 'contractName',
                        align : 'center',
                        title : '合同'
                    },
                    {
                        field : 'score',
                        align : 'center',
                        title : '评分'
                    }]
            };
            $.table.init(options);
        });

    </script>
</body>
</html>
